package com.goktech.olala.core.service.impl;

import com.goktech.olala.core.service.ICustomerService;
import com.goktech.olala.server.dao.customer.CustomerMapper;
import com.goktech.olala.server.pojo.customer.Customer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Classname ICustomerServiceImp
 * @Description TODO
 * @Date 2020/12/10 13:43
 * @Created by ASUS
 */
@Service
public class ICustomerServiceImp implements ICustomerService {

    @Autowired
    CustomerMapper customerMapper;

    @Override
    public int deleteByPrimaryKey(Integer customerInfId) {
        int i = customerMapper.deleteByPrimaryKey(customerInfId);
        return i;
    }

    @Override
    public int insert(Customer record) {
        int i = customerMapper.insert(record);
        return i;
    }

    @Override
    public Customer selectByPrimaryKey(Integer customerInfId) {
        Customer customer = customerMapper.selectByPrimaryKey(customerInfId);
        return customer;
    }

    @Override
    public List<Customer> selectAll() {
        List<Customer> customerList = customerMapper.selectAll();
        return customerList;
    }

    @Override
    public int updateByPrimaryKey(Customer record) {
        int i = customerMapper.updateByPrimaryKey(record);
        return i;
    }

    @Override
    public Customer selectByEmail(String email) {
        Customer customer = customerMapper.selectByEmail(email);
        return customer;
    }
}
